package com.itheima.service;

import com.alibaba.dubbo.config.annotation.Service;
import com.itheima.dao.MemberDao;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.transaction.annotation.Transactional;

import java.util.ArrayList;
import java.util.List;

/**
 * @author 王亚齐
 * @version v1.0
 * @package com.itheima.service
 * @description
 * @date 2019/7/5 17:39
 **/
@Service(interfaceClass = PointService.class)
@Transactional
public class PointServiceImpl implements PointService {
    @Autowired
    private MemberDao memberDao;

    @Override
    public List<Integer> findCountByMonths(List<String> months) {
        List<Integer> countList = new ArrayList();
        months.forEach(month->{
            //2019.09.31
            countList.add(memberDao.findCountByMonth(month+".31"));
        });
        return countList;
    }
}